
export default defineNuxtConfig({
  compatibilityDate: '2024-11-01',
  devtools: { enabled: true },
  runtimeConfig: {
    public: {
      // 新版nuxt3 为了安全 只能 useRuntimeConfig 这么取
      environment: '',
      OPC_URL: '',
      SUP_URL: '',
      HQM_URL: '',
      HTTPS: '',
      DOMAIN: '',
    },
  },
  // 基础设置
  app: {
    baseURL: '/',
    head: {
      title: 'SIPC Global Procurement Platform',
      meta: [{ name: 'description', content: 'SIPC Global Procurement Platform' }],
      link: [
        {
          rel: 'icon',
          type: 'image/x-icon',
          href: '/favicon.ico',
        },
      ],
    },
  },

  // 模块
  modules: [
    '@nuxtjs/tailwindcss', // 示例模块
    '@element-plus/nuxt',
    '@nuxtjs/i18n',
    '@pinia/nuxt',
    '@vueuse/nuxt',
    '@pinia-plugin-persistedstate/nuxt',
  ],
  elementPlus: {
    importStyle: 'scss',
  },
  i18n: {
    locales: [
      { code: 'en', name: 'English', file: 'en.json' },
      { code: 'zh', name: '简体中文', file: 'zh.json' },
    ],
    lazy: true,
    langDir: 'locales/',
    defaultLocale: 'en',
    strategy: 'no_prefix',
  },
  pinia: {},
  // imports: {
  //   dirs: ['stores'],
  // },
  css: [
    '@/assets/css/common.scss',
    '@/assets/css/iconfont.scss', // 添加图标样式
    '@/assets/css/iconfont/iconfont.css',
  ],
  // build: {
  //   transpile: ['element-plus'], // 转译 Element Plus
  // },
  devServer: {
    host: '0.0.0.0',
    port: 3002,
  },
  // nitro: {
  //   prerender: {
  //     routes: ['/seg/reg/'], // 预渲染入口
  //   },
  // },
  vite: {
    esbuild: {
      drop: ['debugger'],
      pure: ['console.log', 'console.error', 'console.warn', 'console.debug', 'console.trace'],
    },
    css: {
      preprocessorOptions: {
        scss: {
          additionalData: `@use "@/assets/css/styles/element-variables.scss" as *;`,
        },
      },
    },
  },
})
